<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>

    <style>
      @import-normalize;
      .one {
        width: 200px;
        height: 200px;
        background-color: pink;
      }
      .two {
        width: 100px;
        height: 100px;
        background-color: red;
      }
    </style>
  </head>

  <body>
    <div id="app">
      <div>
        <p>{{ message }}</p>
        <button @click="changeMessage">Change Message</button>
      </div>
    </div>
    <script src="./vue.js"></script>
    <script>
      const app = new Vue({
        el: "#app",
        data() {
          return {
            message: "Hello Vue!",
          };
        },
        methods: {
          changeMessage() {
            this.message = "New Message";
          },
        },
        watch: {
          message: function (newVal, oldVal) {
            console.log("旧的值和新的值：",oldVal, newVal);
          },
        },
      });
    </script>
  </body>
</html>
